<?php
/**
 * Created by PhpStorm.
 * User: haobin
 * Date: 2016/11/3
 * Time: 14:36
 * 回复问题
 */
require('../conn.php');
require('../functions.php');
require('admin.php');
if($_POST){
    $title = $_POST['title'];
	$content = $_POST['content'];
    $res = $mysql->execute("INSERT INTO `fre_questions` (title,content) VALUES ('$title', '$content')");
    if($res){
        echo "<script>alert('添加成功!')</script>";
        echo "<script>location.href='./common_question.php'</script>";
    }
}
?>
<?php include('head.php') ?>
<div class="container-fluid">
    <div class="row-fluid">
        <?php include('left.php'); ?>
        <div class="span9">
            <div class="well">
                <div id="myTabContent" class="tab-content">
                    <div class="tab-pane active in" id="home">
                        <div class="well">
                            <form action="" method="post">
                                
                                <textarea rows="10" style="width: 50%;" name="title"></textarea>
                                <br>
                                <textarea rows="10" style="width: 50%;" name="content"></textarea>
                                <br>
                                <button class="btn btn-primary" type="submit">添加</button>
                            </form>
                        </div>
                    </div>
                    <div class="tab-pane fade" id="profile">
                    </div>
                </div>

            </div>

        </div>
    </div>
</div>
<script src="lib/bootstrap/js/bootstrap.js"></script>
</body>
</html>